home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Demos / AppMaker 2.0b3 / Demo AppMaker 1.5 / Demo AppMaker™ / Demo AppMaker™.rsrc / TmC3_105_Dialog < prev    next >
Encoding:
Text File  |  1992-04-08  |  1.7 KB  |  87 lines

  1. // %filename% -- dialog 
  2. // Created %date% %time% by AppMaker 
  3.  
  4. #include "U%dlogname%.h"
  5.  
  6. #ifndef __TYPES__
  7. #include <Types.h>
  8. #endif
  9.  
  10. #ifndef __PACKAGES__
  11. #include <Packages.h>
  12. #endif
  13.  
  14. #include "ResourceDefs.h"
  15.  
  16. %for each item gen itemNr%
  17.  
  18. %for each item gen classMethods%
  19. #pragma segment ARes
  20. //----------
  21. pascal void T%dlogname%::DoEvent%    %(EventNumber    eventNumber,
  22.                                      TEventHandler    *source, 
  23.                                        TEvent            *event)
  24. {
  25.     long        origID;
  26.  
  27.     origID = (long) (source->fIdentifier);
  28.     %if modalOneShot%
  29.         switch (origID) {
  30.             %for each item gen doOneShot%
  31.     
  32.         } /* switch */
  33.     %else%
  34.         switch (origID) {
  35.             %for each item gen doChoice%
  36.     
  37.         } /* switch */
  38.  
  39.         inherited::DoEvent (eventNumber, source, event);
  40.     %endif%
  41. } /* HandleEvent */
  42.  
  43. %if modeless%
  44.     #pragma segment AOpen
  45.     //----------
  46.     TWindow *New%dlogname% (void)
  47.     {
  48.         TWindow            *theWindow;
  49.  
  50.         theWindow = gViewServer->NewTemplateWindow (k%dlogname%ID, NULL);
  51.         theWindow->fFreeOnClosing = FALSE;
  52.  
  53.         // initialize subviews from current settings
  54.  
  55.         macroDontDeadStrip (T%dlogname%);
  56.         %for each item gen gDeadStripSuppression%
  57.  
  58.         return (theWindow);
  59.     } /*New%dlogname%*/
  60. %else%
  61.     #pragma segment ASelCommand
  62.     //----------
  63.     void Do%dlogname% (void)
  64.     {
  65.         TWindow            *aWindow;
  66.         TDialogView        *aDialogView;
  67.         OSType            dismisser;
  68.  
  69.         aWindow = gViewServer->NewTemplateWindow (k%dlogname%ID, NULL);
  70.         FailNIL (aWindow);
  71.  
  72.         // initialize subviews from current settings
  73.  
  74.         aDialogView = (TDialogView *)(aWindow->FindSubView ('dlog'));
  75.         dismisser = aWindow->PoseModally ();
  76.         if (dismisser != aDialogView->fCancelItem) {
  77.             // use new settings from subviews
  78.         }
  79.         aWindow->CloseAndFree ();
  80.  
  81.         macroDontDeadStrip (T%dlogname%);
  82.         %for each item gen gDeadStripSuppression%
  83.  
  84.     } /* Do%dlogname% */
  85.  
  86. /* U%dlogname% */
  87.